age= 20 
# 注意使用:代替{}
if age > 18:
    print("You are eligible to vote")
elif age == 17:
    print("You are almost eligible to vote")
else:
    print("You are not eligible to vote")

str=input()
if(str ==""):
    print("String is empty")
else:
    print(str)

# match
score = 'B'
if score == 'A':
    print('score is A.')
elif score == 'B':
    print('score is B.')
elif score == 'C':
    print('score is C.')
else:
    print('invalid score.')

# match 注意 3.10以上版本
match score:
    case 'A':   
         print('score is A.')
    case 'B':   
         print('score is B.')
    case 'C':   
         print('score is C.')

# 复杂匹配

match score:
    case x if x == 'A':
        print('score is A.')

# for
arr=[1,3,4,5]
for i in arr:
    print(i)

# while
n =1 
while( n< 100):
    if(n >10):
      break
    print(n)
    n = n+1
print('end')


while n < 10:
    n = n + 1
    if n % 2 == 0: # 如果n是偶数，执行continue语句
        continue # continue语句会直接继续下一轮循环，后续的print()语句不会执行
    print(n)
